package com.aspose.cells;

public class DisplayUnitLabel extends ChartFrame {
   private Axis m;
   private int n = 1;
   private int o = 1;
   private int p;
   private String q;
   byte[] l;
   private boolean r = false;
   private boolean s = false;
   private int t = 0;

   DisplayUnitLabel(Axis axis) {
      super(axis.a());
      this.m = axis;
      this.getBorder().setVisible(false);
      this.getArea().setFormatting(1);
      if (!ChartCollection.h(axis.a().getType())) {
         this.setRotationAngle(90);
      }

      if (axis.a().getChartArea() != null) {
         this.h = axis.a().getChartArea().getAutoScaleFont();
      }

      this.getFont().setBold(true);
      this.b(7);
   }

   Axis a() {
      return this.m;
   }

   public int getTextHorizontalAlignment() {
      return this.n;
   }

   public void setTextHorizontalAlignment(int value) {
      switch(value) {
      case 1:
      case 3:
      case 6:
      case 7:
      case 8:
         this.n = value;
      case 2:
      case 4:
      case 5:
      default:
      }
   }

   public int getTextVerticalAlignment() {
      return this.o;
   }

   public void setTextVerticalAlignment(int value) {
      switch(value) {
      case 0:
      case 1:
      case 3:
      case 6:
      case 9:
         this.o = value;
      case 2:
      case 4:
      case 5:
      case 7:
      case 8:
      default:
      }
   }

   public int getRotationAngle() {
      return this.p;
   }

   public void setRotationAngle(int value) {
      if ((value < -90 || value > 90) && value != 255) {
         throw new IllegalArgumentException("Invalid rotation : it must be between -90 and 90 or equal 255");
      } else {
         this.p = value;
      }
   }

   /** @deprecated */
   public int getRotation() {
      return this.p;
   }

   /** @deprecated */
   public void setRotation(int value) {
      this.setRotationAngle(value);
   }

   String z() {
      return this.q;
   }

   public String getText() {
      if (!this.m.isDisplayUnitLabelShown()) {
         return "";
      } else {
         if (this.q == null) {
            switch(this.m.getDisplayUnit()) {
            case 0:
               return "";
            case 1:
               return "Hundreds";
            case 2:
               return "Thousands";
            case 3:
            case 4:
            case 6:
            case 7:
            default:
               break;
            case 5:
               return "Millions";
            case 8:
               return "Billions";
            case 9:
               return "Trillions";
            }
         }

         return this.q;
      }
   }

   public void setText(String value) {
      this.q = value;
   }

   public String getLinkedSource() {
      if (this.l == null) {
         return null;
      } else {
         Chart var1 = this.getChart();
         zik var2 = zin.a(var1.j(), var1.getWorksheet());
         var2.a(this.l);
         var2.a(2);
         return var2.h();
      }
   }

   public void setLinkedSource(String value) {
      Chart var2 = this.getChart();
      zik var3 = zin.a(var2.j(), var2.getWorksheet(), value);
      this.l = var3.f();
      this.q = var3.i();
   }

   void a(String var1) {
      Chart var2 = this.getChart();

      try {
         zik var3 = zin.a(var2.j(), var2.getWorksheet(), var1);
         this.l = var3.f();
      } catch (Exception var4) {
         com.aspose.cells.a.c.zl.b(var4);
      }

   }

   public Font getFont() {
      if (this.f == null) {
         this.f = new Font(this.getChart().j(), (Object)null, true);
         Font var1 = null;
         if (this.g != -1) {
            var1 = this.getChart().j().j(this.g);
            this.f.c(var1);
            this.f.b.b(true);
            zbi var2 = this.getChart().c(this.g);
            if (var2 != null) {
               zbi var3 = new zbi(var2.f, 0, false);
               var3.a(var2);
               this.f.a((Object)var3);
            }
         } else {
            if (this.m.a().getChartArea() != null) {
               this.f.c(this.m.a().getChartArea().getFont());
               this.f.l();
            }

            if (this.getAutoScaleFont()) {
               this.f.a((Object)(new zbi(this.getChart(), 10, true)));
            }
         }
      }

      return this.f;
   }

   public boolean getAutoScaleFont() {
      return this.h;
   }

   public void setAutoScaleFont(boolean value) {
      if (this.h != value) {
         if (value) {
            if (this.f != null) {
               zbi var2 = new zbi(this.getChart(), this.f.getSize(), true);
               this.f.a((Object)var2);
            }
         } else {
            this.getFont().a((Object)null);
         }

         this.h = value;
      }
   }

   boolean A() {
      return this.r;
   }

   void j(boolean var1) {
      this.r = var1;
   }

   boolean B() {
      return this.s;
   }

   void k(boolean var1) {
      this.s = var1;
   }

   public int getTextDirection() {
      return this.t;
   }

   public void setTextDirection(int value) {
      this.t = value;
   }

   void a(DisplayUnitLabel var1, CopyOptions var2) {
      super.a(var1, var2);
      this.p = var1.p;
      this.n = var1.n;
      this.o = var1.o;
      this.r = var1.r;
      this.t = var1.t;
      this.q = var1.q;
   }

   boolean C() {
      return this.getBorder().isVisible() || this.getArea().getFormatting() != 1;
   }
}
